package com.zhende.hr.entity;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class CustomUserDetails implements UserDetails {

    private String username;
    private String password;
    private String uuid;
    private Collection<? extends GrantedAuthority> authorities;

    // 构造方法
    public CustomUserDetails(String username, String password, String uuid, Collection<? extends GrantedAuthority> authorities) {
        this.username = username;
        this.password = password;
        this.uuid = uuid;
        this.authorities = authorities;
    }

    public String getUuid() {
        return uuid;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;  // 根据需求，你可以实现这些方法，设置账号是否过期等
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
